package my.jwds.p172;

import java.math.BigInteger;

public class TrailingZeroes {
    public static void main(String[] args) {
        TrailingZeroes o = new TrailingZeroes();
        System.out.println(o.trailingZeroes(125));
    }

    public int trailingZeroes(int n) {
        int div = 5;
        int res = 0;
        for (; div <= n; div*=5) {
            res += n/div;
        }
        return res;
    }
}
